package com.jast.business.service.impl;

import java.util.List;
import com.jast.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jast.business.mapper.BigdataZookeeperKvMapper;
import com.jast.business.domain.BigdataZookeeperKv;
import com.jast.business.service.IBigdataZookeeperKvService;
import com.jast.common.core.text.Convert;

/**
 * Zookeeper监控指标最新值Service业务层处理
 * 
 * @author Jast
 * @date 2023-02-16
 */
@Service
public class BigdataZookeeperKvServiceImpl implements IBigdataZookeeperKvService 
{
    @Autowired
    private BigdataZookeeperKvMapper bigdataZookeeperKvMapper;

    /**
     * 查询Zookeeper监控指标最新值
     * 
     * @param id Zookeeper监控指标最新值主键
     * @return Zookeeper监控指标最新值
     */
    @Override
    public BigdataZookeeperKv selectBigdataZookeeperKvById(Long id)
    {
        return bigdataZookeeperKvMapper.selectBigdataZookeeperKvById(id);
    }

    /**
     * 查询Zookeeper监控指标最新值列表
     * 
     * @param bigdataZookeeperKv Zookeeper监控指标最新值
     * @return Zookeeper监控指标最新值
     */
    @Override
    public List<BigdataZookeeperKv> selectBigdataZookeeperKvList(BigdataZookeeperKv bigdataZookeeperKv)
    {
        return bigdataZookeeperKvMapper.selectBigdataZookeeperKvList(bigdataZookeeperKv);
    }

    /**
     * 新增Zookeeper监控指标最新值
     * 
     * @param bigdataZookeeperKv Zookeeper监控指标最新值
     * @return 结果
     */
    @Override
    public int insertBigdataZookeeperKv(BigdataZookeeperKv bigdataZookeeperKv)
    {
        bigdataZookeeperKv.setCreateTime(DateUtils.getNowDate());
        return bigdataZookeeperKvMapper.insertBigdataZookeeperKv(bigdataZookeeperKv);
    }

    /**
     * 更新/新增Zookeeper监控指标最新值
     *
     * @param bigdataZookeeperKv Zookeeper监控指标最新值
     * @return 结果
     */
    @Override
    public int upsertBigdataZookeeperKv(BigdataZookeeperKv bigdataZookeeperKv)
    {
                bigdataZookeeperKv.setUpdateTime(DateUtils.getNowDate());
            return bigdataZookeeperKvMapper.upsertBigdataZookeeperKv(bigdataZookeeperKv);
    }

    /**
     * 修改Zookeeper监控指标最新值
     * 
     * @param bigdataZookeeperKv Zookeeper监控指标最新值
     * @return 结果
     */
    @Override
    public int updateBigdataZookeeperKv(BigdataZookeeperKv bigdataZookeeperKv)
    {
        bigdataZookeeperKv.setUpdateTime(DateUtils.getNowDate());
        return bigdataZookeeperKvMapper.updateBigdataZookeeperKv(bigdataZookeeperKv);
    }

    /**
     * 批量删除Zookeeper监控指标最新值
     * 
     * @param ids 需要删除的Zookeeper监控指标最新值主键
     * @return 结果
     */
    @Override
    public int deleteBigdataZookeeperKvByIds(String ids)
    {
        return bigdataZookeeperKvMapper.deleteBigdataZookeeperKvByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除Zookeeper监控指标最新值信息
     * 
     * @param id Zookeeper监控指标最新值主键
     * @return 结果
     */
    @Override
    public int deleteBigdataZookeeperKvById(Long id)
    {
        return bigdataZookeeperKvMapper.deleteBigdataZookeeperKvById(id);
    }
}
